Skip to content

parse_config: add timeout to file --mime-encoding subprocess call#2318

Open
nadzyah wants to merge 1 commit intoultrabug:masterfrom
nadzyah:fix-file-subprocess-timeout
Open

parse_config: add timeout to file --mime-encoding subprocess call#2318
nadzyah wants to merge 1 commit intoultrabug:masterfrom
nadzyah:fix-file-subprocess-timeout

Conversation

@nadzyah
Copy link
Copy Markdown

@nadzyah nadzyah commented Mar 2, 2026

parse_config.py calls file --mime-encoding with no timeout. On some architectures (like s390x), this can hang when the magic database is slow to load, blocking py3status startup indefinitely.

The fix adds timeout=3 to check_output() and handles TimeoutExpired the same way as CalledProcessError (fall back to utf-8).

I've initially discovered this issue while trying to fix failing tests for the py3status status package in Ubuntu and Debian

On some architectures (e.g. s390x) the file command can hang when its
magic database is slow to load. Add timeout=3 to check_output() and
handle TimeoutExpired like CalledProcessError, falling back to utf-8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant